org.eclipse.vtp.framework.engine.runtime
Class Session

java.lang.Object
  extended by org.eclipse.vtp.framework.engine.runtime.Scope
      extended by org.eclipse.vtp.framework.engine.runtime.Session
All Implemented Interfaces:
ISession

public class Session
extends Scope
implements ISession

Implementation of the session scope and context.

Author:
Lonnie Pryor

Nested Class Summary
protected  class Session.Context
          Implementation of the generic context.
 
Field Summary
protected  Session.Context context
          The generic context implementation.
protected  Process process
          The owner of this session.
 
Constructor Summary
Session(Process process, ISessionDescriptor descriptor)
          Creates a new Session.
 
Method Summary
 IExecution createExecution(IExecutionDescriptor descriptor)
          Creates a new process execution context at the current location.
 IProcess getProcess()
          Returns the process that created this session.
protected  java.util.Collection getServices(java.lang.String identifier)
           
 java.lang.String getSessionID()
          Returns the ID of the session being described.
 java.lang.Object[] lookupAllServices(java.lang.String identifier)
          Returns an array containing all the services registered under the specified identifier.
 java.lang.Object lookupService(java.lang.String identifier)
          Looks up the service selected for the specified identifier or null if no such service exists.
 
Methods inherited from class org.eclipse.vtp.framework.engine.runtime.Scope
getServiceInstance, lookupAllInScope, lookupInScope, registerImplicitServices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

process

protected final Process process
The owner of this session.


context

protected final Session.Context context
The generic context implementation.

Constructor Detail

Session

public Session(Process process,
               ISessionDescriptor descriptor)
        throws java.lang.NullPointerException
Creates a new Session.

Parameters:
process - The owner of this session.
descriptor - The session descriptor.
Throws:
java.lang.NullPointerException - If the supplied process is null.
java.lang.NullPointerException - If the supplied descriptor is null.
Method Detail

getServices

protected java.util.Collection getServices(java.lang.String identifier)
Specified by:
getServices in class Scope

getSessionID

public java.lang.String getSessionID()
Description copied from interface: ISession
Returns the ID of the session being described.

Specified by:
getSessionID in interface ISession
Returns:
The ID of the session being described.

lookupService

public java.lang.Object lookupService(java.lang.String identifier)
                               throws java.lang.NullPointerException
Description copied from interface: ISession
Looks up the service selected for the specified identifier or null if no such service exists.

Specified by:
lookupService in interface ISession
Parameters:
identifier - The identifier of the service to look up.
Returns:
The service selected for the specified identifier or null if no such service exists.
Throws:
java.lang.NullPointerException - If the supplied identifier is null.

lookupAllServices

public java.lang.Object[] lookupAllServices(java.lang.String identifier)
                                     throws java.lang.NullPointerException
Description copied from interface: ISession
Returns an array containing all the services registered under the specified identifier.

Specified by:
lookupAllServices in interface ISession
Parameters:
identifier - The identifier of the services to look up.
Returns:
An array containing all the services registered under the specified identifier.
Throws:
java.lang.NullPointerException - If the supplied identifier is null.

createExecution

public IExecution createExecution(IExecutionDescriptor descriptor)
                           throws java.lang.NullPointerException
Description copied from interface: ISession
Creates a new process execution context at the current location.

Specified by:
createExecution in interface ISession
Parameters:
descriptor - The descriptor of the execution to create.
Returns:
A new process engine session from the specified descriptor.
Throws:
java.lang.NullPointerException - If the specified descriptor is null.

getProcess

public IProcess getProcess()
Description copied from interface: ISession
Returns the process that created this session.

Specified by:
getProcess in interface ISession
Returns:
The process that created this session.